package cn.itcast.service.impl;

import cn.itcast.dao.BranchCourtsDao;
import cn.itcast.dao.CheckGroupDao;
import cn.itcast.entity.PageResult;
import cn.itcast.pojo.Address;
import cn.itcast.pojo.CheckGroup;
import cn.itcast.service.BranchCourtsService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class BranchCourtsServiceImpl implements BranchCourtsService {
    @Autowired
    private BranchCourtsDao branchCourtsDao;

    /**
     * 查询分院地址
     * @return
     */
    @Override
    public List<Address> findAll() {
        return branchCourtsDao.findAll();
    }

    /**
     * 新增分院地址
     * @param address
     */
    @Override
    public void submit(Address address) {
        branchCourtsDao.submit(address);
    }

    /**
     * 修改分院信息
     * @param address
     * @param checkitemIds
     */
    @Override
    public void update(Address address, String checkitemIds) {
       branchCourtsDao.update(address,checkitemIds) ;
    }

    /**
     * 删除分院地址
     * @param id
     */
    @Override
    public void delete(Integer id) {
        branchCourtsDao.delete(id);
    }

    /**
     * 分页查询所有分院
     * @param currentPage
     * @param pageSize
     * @param queryString
     * @return
     */
//    @Override
//    public PageResult pageQuery(Integer currentPage, Integer pageSize, String queryString) {
//        PageHelper.startPage(currentPage, pageSize);
//        Page<Address> page =  branchCourtsDao.selectByCondition(queryString);
//        return new PageResult(page.getTotal(), page.getResult());
//    }
}
